<?php
include "db_Class.php";
//$search = $HTTP_POST_VARS['search'];
$obj = new db_class();
$obj->MySQL();

// ID phn_no session m_date 

?>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style4 {
	font-size: 36px;
	color: #000066;
}
.style5 {color: #FFFFFF}
.style6 {
	font-size: 18px;
	font-weight: bold;
}
-->
</style></head>

<body>
<div align="center" class="style4">Report of <strong>Homework</strong></div>
<div align="center">
  <form name="form1" method="post" action="rpt_hw.php">
  
    <p class="style6">Search By Session
      <input name="search" type="text" id="search">
      <input type="submit" name="Submit" value="Submit">
</p>
    <table width="970" border="1">
      <tr bgcolor="#000066">
        <th width="103" scope="row"><div align="center"><span class="style5">ID</span></div></th>
        <td width="253"><div align="center"><span class="style5">Phone No </span></div></td>
        <td width="378"><div align="right" class="style5">
          <div align="center">Homework</div>
        </div></td>
        <td width="101"><span class="style5">Session</span></td>
        <td width="101"><div align="center"><span class="style5">Date</span></div></td>
      </tr>
    </table>
	<?php 
  
  if(isset($Submit))
  {
  		$SQL="select * from homework where session='$search'";
  }else
  {
  	$SQL="select * from homework";
  }
  
	
	/**************/
	$obj->sql($SQL);
	$i=0;
	while($row = mysql_fetch_array($obj->result))
	{    
 ?> 
	
    <table width="979" border="1">
      <tr>
        <th width="105" scope="row"><? echo $row['id']?></th>
        <td width="252"><? echo $row['phn_no']?></td>
        <td width="378"><? echo $row['hw']?></td>
        <td width="105"><? echo $row['session']?></td>
        <td width="105"><? echo $row['m_date']?></td>
      </tr>
    </table>
	<? $i++;
	}
?>	
  </form>
  <p>&nbsp;</p>
</div>
</body>
</html>


